﻿package cgs.server.logging.gamedata
{
    import com.adobe.serialization.json.*;
    import flash.utils.*;

    public class UserGameData extends Object
    {
        private var _gameData:Dictionary;

        public function UserGameData()
        {
            this._gameData = new Dictionary();
            return;
        }// end function

        public function containsData(param1:String) : Boolean
        {
            return this._gameData.hasOwnProperty(param1);
        }// end function

        public function getData(param1:String)
        {
            return this._gameData[param1];
        }// end function

        public function updateData(param1:String, param2) : void
        {
            this._gameData[param1] = param2;
            return;
        }// end function

        public function parseUserGameData(param1:Array) : void
        {
            var _loc_2:String = null;
            var _loc_3:* = undefined;
            var _loc_4:JSONDecoder = null;
            var _loc_5:Object = null;
            for each (_loc_5 in param1)
            {
                
                _loc_2 = _loc_5.u_data_id;
                _loc_3 = _loc_5.data_detail;
                if (_loc_3 is String)
                {
                    _loc_4 = new JSONDecoder(_loc_3, true);
                    this._gameData[_loc_2] = _loc_4.getValue();
                    continue;
                }
                this._gameData[_loc_2] = _loc_3;
            }
            return;
        }// end function

    }
}
